package com.ocm.core.mapping;

import org.springframework.stereotype.Component;

import com.googlecode.simpleobjectassembler.converter.AbstractObjectConverter;
import com.ocm.core.domain.Status;

@Component
public class StatusToIntegerConvert extends AbstractObjectConverter<Status, Integer> {

   @Override
   public void convert(Status sourceObject, Integer destinationObject) {
      destinationObject = Integer.valueOf(sourceObject.getStatus());
   }

   @Override
   public Integer createDestinationObject(Status destinationObject) {
      return Integer.valueOf(destinationObject.getStatus());
   }

   @Override
   protected boolean disableAutoMapping() {
      return true;
   }
}
